<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>js-function-arguments</title>
</head>
<body>
	
</body>
</html>
<script type="text/javascript">
function max(){
	//定义变量max为负无穷大
	var max = Number.NEGATIVE_INFINITY;
	//遍历实参，查找并记住最大值
	for(var i = 0,len = arguments.length;i < len;i++){
		if(arguments[i] > max) max = arguments[i];
	};
	//返回最大值
	return max;
};

alert(max(1,2,3,4,5,6,7,8,9,10,100,1000));
</script>